import axios from "@/utils/http";
export const listApp = (options) =>
  axios.request({
    ...options,
    url: "/api/v1/app/list",
    method: "post",
  });
export const listAppOfEnable = (options) =>
  axios.request({
    ...options,
    url: "/api/v1/app/list",
    method: "get",
  });
export const deleteApp = (appId, options) =>
  axios.request({
    ...options,
    url: "/api/v1/app/" + appId,
    method: "delete",
  });
export const batchDeleteApp = (options) =>
  axios.request({
    ...options,
    url: "/api/v1/app/",
    method: "delete",
  });
export const batchEnabledApp = (options) =>
  axios.request({
    ...options,
    url: "/api/v1/app/enabled",
    method: "put",
  });
export const batchDisabledApp = (options) =>
  axios.request({
    ...options,
    url: "/api/v1/app/disabled",
    method: "put",
  });
export const addApp = (options) =>
  axios.request({
    ...options,
    url: "/api/v1/app/",
    method: "post",
  });

export const updateApp = (options) =>
  axios.request({
    ...options,
    url: "/api/v1/app/",
    method: "put",
  });
export default { listApp, deleteApp, addApp, updateApp };
